package PTA.javaA;
import java.util.Scanner;

public class ex04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            String line = sc.nextLine();
            int sum=0;
            for(int i=0;i<line.length();i++){
                char b = line.charAt(i);
                if(b!='-'&&b!='.'){
                    int c = b-'0';
                    sum+=c;
                }
            }
            System.out.println(sum);
        }
    }
}
